#define e_init  emdg_mem_init
#define e_malloc(hashtbl, size) \
    emdg_malloc(hashtbl, size, __FILE__, __LINE__)

#define e_free(ht,p)  emdg_free(ht, p, __FILE__, __LINE__)
#define e_free_all  emdg_free_all
#define e_print emdg_mem_print
#define e_destroy emdg_mem_destroy


#ifndef __MEMDEBUG_H__
#define __MEMDEBUG_H__

#include <stdio.h>
#include <glib.h>

typedef struct __mm
{
    char            file[32];
    unsigned int    line;
    unsigned int    len;
    void            *pointer;
}MeM;

GHashTable* emdg_mem_init(const char *filename);
void*       emdg_malloc (GHashTable *, int size, const char* filename, int line);
void        emdg_free (GHashTable *, void*, const char*, int);
void        emdg_free_all (GHashTable *ht);
void        emdg_mem_print(GHashTable *ht);
void        emdg_mem_destroy(GHashTable *ht);

MeM*        mem_new (int size, const char* filename, int line);
void        mem_delete (MeM*);

#endif

